import { CommonModule } from '@angular/common';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-emp',
  standalone: true,
  imports: [CommonModule],
  templateUrl: './emp.component.html',
  styleUrl: './emp.component.css',
})
export class EmpComponent implements OnInit {
  empList:any = [];

  constructor(private http: HttpClient) {}

  ngOnInit(): void {
    // let headers = {};

    this.http.get('/spring-mybatis/employ/empList2').subscribe((res: any) => {
      console.log(res);
      if (res.code != 0) {
        // 接口异常
      }

      this.empList = res.list;
    });
  }
}
